<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "cart".
 *
 * @property integer $id
 * @property integer $user_id
 * @property string $session_id
 * @property integer $product_id
 * @property string $sku
 * @property string $name
 * @property integer $number
 * @property string $market_price
 * @property string $price
 * @property string $thumb
 * @property integer $type
 * @property integer $created_at
 * @property integer $updated_at
 */
class Cart extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'cart';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'product_id', 'number', 'type', 'created_at', 'updated_at'], 'integer'],
            [['product_id', 'sku', 'name', 'created_at', 'updated_at'], 'required'],
            [['market_price', 'price'], 'number'],
            [['session_id', 'name', 'thumb'], 'string', 'max' => 255],
            [['sku'], 'string', 'max' => 64],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'session_id' => 'Session ID',
            'product_id' => 'Product ID',
            'sku' => 'Sku',
            'name' => 'Name',
            'number' => 'Number',
            'market_price' => 'Market Price',
            'price' => 'Price',
            'thumb' => 'Thumb',
            'type' => 'Type',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
